package com.ruoyi.system.controller;

import com.ruoyi.common.core.web.controller.BaseController;
import com.ruoyi.common.core.web.domain.AjaxResult;
import com.ruoyi.system.service.IVegetableMarketService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * 蔬菜市场数据控制器
 */
@RestController
@RequestMapping("/dashboard")
public class VegetableMarketController extends BaseController {
    
    @Autowired
    private IVegetableMarketService vegetableMarketService;

    /**
     * 获取蔬菜市场数据
     */
    @GetMapping("/vegetable-market")
    public AjaxResult getVegetableMarketData() {
        return AjaxResult.success(vegetableMarketService.getVegetableMarketData());
    }

    /**
     * 获取销售排名数据
     */
    @GetMapping("/sales-rank")
    public AjaxResult getSalesRankData() {
        return AjaxResult.success(vegetableMarketService.getSalesRankData());
    }

    /**
     * 获取销售趋势数据
     */
    @GetMapping("/sales-trend")
    public AjaxResult getSalesTrendData() {
        return AjaxResult.success(vegetableMarketService.getSalesTrendData());
    }
} 